{% extends '__base.tpl' %}
{% block head %}
{%if data%}
<title>编程达人 {{data.title}}</title>
<meta name="keywords" content="编程达人问答,回答得红包,{{data.title}}" />
<meta name="description" content="{{data.content|toDescription}}"/>
{%endif%}
<!-- build:css -->
<link rel="stylesheet" href="../../../public/css/other/wangEditor.css">
<link rel="stylesheet" href="../../../public/css/other/wangEditor-extend.css">
<link rel="stylesheet" type="text/css" href="../../../public/css/other/shCore.css">
<link rel="stylesheet" type="text/css" href="../../../public/css/other/shThemeRDark.css">
<link rel="stylesheet" type="text/css" href="../../../public/css/page/contentPage.css" />
<link rel="stylesheet" type="text/css" href="../../../public/css/page/popup.css" />
<!-- endbuild -->
{% endblock %}

{% block body %}

<div id='box'  class="has-code"  data-title="编程达人问答-{{data.title|safe}}"
     data-id="{{data.id}}" data-comment_type="3"
     data-description="编程达人问答-{{data.title}}" data-uptype="question">
    {%if data%}
    <div id='content' data-memberid="{{data.memberId}}">
        <div class="contHead clearfix relative" >
           <span class="fleft iblock answer-title" >
               <span class="font24">{{data.title|safe}}</span>
                    <span class="red font13">
                   {%if data.maxGoodCount*data.unitPrice>0%}
                   共{{data.maxGoodCount}}个红包，
                   当前剩余{{data.maxGoodCount-data.currentGoodCount}}个，
                   每个{{data.unitPrice}}元
                   {%endif%}
               </span>
           </span>
           <span class="fright btnStyleS openclass-icon middle-right" style="margin: 0">互助问答</span>
        </div>
        <div class="contBody" style="min-height:180px;">
            <ul class="darenList">
                <li class="darenList-item clearfix">
                    <div class="head-img-box">
                        <a target="_blank" href="/{{data.memberId}}/userInfo.html">
                            <img class="fleft head-img" src="{{data.header|imgPath}}" />
                        </a>
                    </div>
                    <div class="fleft">
                        <h5 class="font16 clo3 relative">
                            <a target="_blank" href="/{{data.memberId}}/userInfo.html">
                                {{data.memberNickName}}
                                {% if data.memberType==='V' %}
                                <img src="../../../public/images/daren1.jpg" class="iconLV1" />
                                {% elif data.memberType==='D' %}
                                <img src="../../../public/images/daren2.jpg" class="iconLV" />
                                {% endif  %}
                                <span class="clo9 ml10">等级 {{data.memberType}}{{ (data.gradeValue/100)|int }}</span>
                            </a>
                            <span  class="hide" data-memberid="{{data.memberId}}" id="memberNotice">
                                <button class="btnStyleS ml20 hide"
                                        onclick="BASE.COMMON.noticeToMember(this)"
                                        data-memberid="{{data.memberId}}">+ 关注</button>
                                <button class="btnStyleC ml20 hide"
                                        onclick="BASE.COMMON.cancelNotice(this)"
                                        data-memberid="{{data.memberId}}">已关注</button>
                            </span>
                            <span id="memberModify" {%if data.answerCount>0%} class="hide" {%endif%} style="display:none">
                                <button  data-content="{{data.content}}"
                                     data-title="{{data.title|safe}}"
                                     data-covers="{{data.covers}}"
                                     data-categoryid="{{data.categoryId}}"
                                     onclick="BASE.ANSWER_CONTENT.modifyPopupShow(this)"
                                     class="btnBlueM ml30"> 修改</button>
                            </span>
                        </h5>
                        <div class="clo9 font12">{{data.createDateTime|dateFormat}}</div>
                        <div class="ptb20 clo3 editor-content w-e-text"> {{data.content|codeContent|safe}}</div>
                    </div>
                </li>
            </ul>
        </div>
    </div><!-- end content-->
    {%else%}
    <div class="pd20 font16 center">你来晚了，问题不在了...</div>
    {%endif%}
    <div class="lmessage">
        <div class="commentTag" style="overflow: visible">
            <ul class="clearfix">
                <li>浏览 <em>{{data.clickCount}}</em></li>
                <li>点赞 <em>{{data.likeCount}}</em></li>
                <li>分享 <em>{{data.shareCount}}</em></li>
                <li class="social-share ml20"  data-initialized="true">分享：
                    {%include '__share1.html'%}
                </li>
                <li class="pointer mr20" style="float: right">
                    <span id="likeIs">
                        <span onclick="BASE.ANSWER_CONTENT.zanQes(this);">
                            <img src='../../../public/images/zan.jpg' class="vsub mr5">点赞
                        </span>
                        <span onclick="BASE.ANSWER_CONTENT.unzanQes(this);" class="orange hide">
                            <img src='../../../public/images/zan_h.png' class="vtop mr10">已赞
                        </span>
                    </span>
                     <span id="collectIs" class="ml20">
                        <span data-id="{{data.id}}" onclick="BASE.COMMON.collectQes(this)">
                             <img src="../../../public/images/collect.jpg" class="vmiddle mr5">收藏
                        </span>
                        <span data-id="{{data.id}}" onclick="BASE.COMMON.uncollectQes(this)" class="orange hide">
                            <img src='../../../public/images/collect_h.png' class="vmiddle mr10">已收藏
                        </span>
                    </span>
                </li>
            </ul>
        </div>
        <div class="lmessageB">
            <span class="lmText">回答
                {% if data.answerCount>0 %}
                ({{data.answerCount}})
                {% endif %}
            </span>
        </div>
        <div class="lmessageC relative">
             <div class="edtior-wrap">
               <div id="editorContent"></div>
             </div>

            <div class="tright mt10">
                <button class="btnBlueM" id="and_answer_btn" onclick="BASE.ANSWER_CONTENT.addAnswer(this)">发送</button>
                <button class="btnBlueM" id="modify_answer_btn" style="display: none"
                        onclick="BASE.ANSWER_CONTENT.modifyAnswer(this)">确认修改</button>
            </div>

            <div id="answerList">
                <ul class="lmessageList darenList"></ul>
                <div class="loading">正在加载中...</div>
                <div class="nomore-data">---到底了---</div>
            </div>
           <!--------------------------------- 回答列表start---------------------->
            <script id="answerList_tpl" type="text/html">
                <%each data.list as arr i%>
                <li class="darenList-item clearfix" id="answerId_<%arr.id%>">
                    <div class="head-img-box pointer">
                        <a target="_blank" href="/<%arr.memberId%>/userInfo.html">
                            <img class="fleft head-img" src=" <%= imgPath(arr.header)%>" />
                        </a>
                    </div>
                    <div class="fleft">
                        <h5 class="font15 clo3" style="width: 1096px">
                            <a target="_blank" href="/<%arr.memberId%>/userInfo.html" class="pointer">
                                <% arr.memberNickName %>
                                <% if arr.memberType==='V' %>
                                <img src="../../public/images/daren1.jpg" class="iconLV1" />
                                <% else if arr.memberType==='D' %>
                                <img src="../../public/images/daren2.jpg" class="iconLV" />
                                <%/if%>
                                <span class="clo9 ml10 font12">等级 <%arr.memberType%><%=toFloat(arr.gradeValue/100),0%></span>
                            </a>
                            <%if data.userId!=arr.memberId %>
                            <button class="btnStyleS ml10 <%if arr.followIs&&arr.followIs!=undefined%> hide <%/if%>"  data-memberid="<%arr.memberId%>"
                                    onclick="BASE.COMMON.noticeToMember(this)"> + 关注</button>
                            <button class="btnStyleC ml10 <%if !arr.followIs||arr.followIs==undefined%> hide <%/if%>" data-memberid="<%arr.memberId%>"
                                    onclick="BASE.COMMON.cancelNotice(this)">已关注</button>
                            <%/if%>
                            <%if !arr.goodAnswerIs && data.questionMemberId==data.userId%>
                                {%if ((data.maxGoodCount>0) and (data.maxGoodCount-data.currentGoodCount >0)) or (data.maxGoodCount<=0)%}
                                 <button class="common-btn blue-border-btn fright" style="height: 30px;line-height: 30px;"
                                         data-id="<%arr.id%>" onclick="BASE.ANSWER_CONTENT.setGoodAnswer(this)">
                                     选为最佳回答
                                 </button>
                                {%endif%}
                            <%/if%>
                            <span class="red fright font16 mr10 <%if !arr.goodAnswerIs%> hide <%/if%>">最佳回答</span>
                        </h5>
                        <div class="clo9 font12"><%=dateFormat(arr.createDateTime,'yyyy-MM-dd hh:mm')%></div>
                        <p class="mt20 clo3" >
                            <%=toOveHtml(arr.content) %>
                            <%if contentIsOve(arr.content)%>
                            <a class="pointer blue" href="javascript:;"
                               onclick="$(this).parent().hide().next().slideDown()">查看全文</a>
                            <%/if%>
                        </p>
                        <div class="mt20 clo3 hide relative editor-content w-e-text" style="overflow: visible">
                            <%#codeContent(arr.content)%>
                            <a class="pointer blue look-all" href="javascript:;"
                               onclick="$(this).parent().slideUp().prev().show()">收起全文</a>
                        </div>
                        <div class="clo9 mt20 pointer">
                            <span>
                                <span data-id="<%arr.id%>" <%if arr.likeIs%> class="hide" <%/if%>
                                      onclick="BASE.ANSWER_CONTENT.zanAnswer(this);">
                                    <img src='../../../public/images/zan.jpg' class="vsub mr5">
                                    <span><% arr.likeCount%></span>
                                </span>
                                <span  data-id="<%arr.id%>"
                                       onclick="BASE.ANSWER_CONTENT.unzanAnswer(this);"
                                       class="orange <%if !arr.likeIs%> hide <%/if%>">
                                    <img src='../../../public/images/zan_h.png' class="vtop mr10">
                                    <span><% arr.likeCount%></span>
                                </span>
                            </span>
                            <span class="ml10" data-id="<%arr.id%>"
                                  onclick="BASE.ANSWER_CONTENT.getCommentReply.call(this,1)">
                                <span class="ml5">评论</span>
                                <span class="ml5 commentCount"><% arr.commentCount%></span>
                            </span>
                            <% if data.userId==arr.memberId && !arr.goodAnswerIs%>
                                <a class="ml10 clo9 fright" href="javascript:;" data-id="<%arr.id%>"
                                   onclick="BASE.ANSWER_CONTENT.removeAnswer(this)">
                                    删除
                                </a>
                                <a class="ml10 blue fright" href="javascript:;"
                                        data-content="<%arr.content%>"
                                        data-id="<%arr.id%>" onclick="BASE.ANSWER_CONTENT.modifyAnserPrev(this)">
                                    修改
                                </a>
                            <%/if%>
                            <!--<span class="ml10">
                                <span data-id="<%arr.id%>" onclick="BASE.ANSWER_CONTENT.collectVideo(this)">
                                     <img src="public/images/collect.jpg" class="vmiddle mr5">收藏
                                </span>
                                <span data-id="<%arr.id%>" onclick="BASE.ANSWER_CONTENT.cancelcollectVideo(this)" class="orange hide">
                                    <img src='public/images/collect_h.png' class="vmiddle mr10">已收藏
                                </span>
                            </span>-->
                        </div>
                        <div class="follow-list hide">
                            <div class="mb10 tright">
                                <textarea placeholder="写下你的评论..." maxlength="200"></textarea>
                                <button class="btnBlueM" data-id="<%arr.id%>"
                                        onclick="BASE.ANSWER_CONTENT.addComment(this)">发送</button>
                            </div>
                            <div id="commentList_<%arr.id%>" >
                                <ul class="darenList" style="background:#f8f8f8;"></ul>
                                {% include '__page.html' %}
                            </div>
                            <div class="mt10 center slideComment <%if arr.commentCount<1%> hide <%/if%>">
                                <button class="btnStyleC" style="color: #999;"
                                        onclick="$(this).parents('.follow-list').slideUp()">收起评论</button>
                            </div>
                        </div>
                    </div>
                </li>
                <%/each%>
            </script>
            <!--------------------------------- 回答列表end---------------------->
                <script id="commentList_tpl" type="text/html">
                    <%each data.commentList as arr i%>
                    <li class="darenList-item clearfix comment-item">
                        <div class="head-img-box pointer">
                            <a target="_blank" href="/<%arr.memberId%>/userInfo.html">
                                <img class="fleft head-img" src=" <%= imgPath(arr.header)%>" />
                            </a>
                        </div>
                        <div class="fleft">
                            <h5 class="font15 clo3">
                                <a target="_blank" href="/<%arr.memberId%>/userInfo.html" class="pointer">
                                    <% arr.memberNickName %>
                                    <% if arr.memberType==='V' %>
                                    <img src="../../public/images/daren1.jpg" class="iconLV1" />
                                    <% else if arr.memberType==='D' %>
                                    <img src="../../public/images/daren2.jpg" class="iconLV" />
                                    <%/if%>
                                    <span class="clo9 ml10 font12">等级 <%arr.memberType%><%=toFloat(arr.gradeValue/100),0%></span>
                                </a>
                                <% if data.userId!=arr.memberId %>
                                <button class="btnStyleS ml10 <%if arr.followIs&&arr.followIs!=undefined%> hide <%/if%>"  data-memberid="<%arr.memberId%>"
                                        onclick="BASE.COMMON.noticeToMember(this)"> + 关注</button>
                                <button class="btnStyleC ml10 <%if !arr.followIs||arr.followIs==undefined%> hide <%/if%>" data-memberid="<%arr.memberId%>"
                                        onclick="BASE.COMMON.cancelNotice(this)">已关注</button>
                                <%/if%>
                            </h5>
                            <div class="clo9 font12"><%=dateFormat(arr.createDateTime,'yyyy-MM-dd hh:mm')%></div>
                            <p class="mt20 clo3"> <% arr.content %> </p>
                            <!--回复跟帖start-->
                            <%if arr.tempReplyList.length>0%>
                            <ul class="follow-list">
                                <%each arr.tempReplyList as next i%>
                                <li class="font14">
                                    <p class="clo3 comment-content">
                                    <span class="reply">
                                        <a target="_blank" href="/<%next.memberId%>/userInfo.html" class="blue pointer"><% next.memberNickName %></a>
                                        回复
                                        <a target="_blank" href="/<%next.replyToMemberId%>/userInfo.html"  class="blue pointer"> <% next.replyToNickName %></a>：
                                        <span class="clo6 reply-content"><% next.content %></span>
                                    </span>
                                    <div class="tright">
                                        <span class="clo9 font12"><%=dateFormat(next.createDateTime,'yyyy-MM-dd hh:mm')%></span>
                                        <% if data.userId!=next.memberId %>
                                        <a href="javascript:;" data-commentid="<% next.commentId %>" data-replyid="<% next.memberId %>"
                                           onclick="BASE.COMMON.replyPrev(this)" class="blue mr10 font12">回复</a>
                                        <%/if%>
                                    </div>
                                    </p>
                                </li>
                                <%/each%>
                            </ul>
                            <%/if%>
                            <!--回复跟帖end-->
                            <% if data.userId!=arr.memberId %>
                            <div class="mt20">
                                <a href="javascript:;" data-commentid="<% arr.id %>" data-replyid="<% arr.memberId %>"
                                   onclick="BASE.COMMON.replyPrev(this)" class="blue">回复</a>
                                <!-- <a href="javascript:;" class="clo6 ml30">举报</a>-->
                            </div>
                            <%/if%>
                            <!-- 回复框-->
                            <div class="tright hide reply-textarea-box">
                                <textarea  placeholder="填写回复的内容..." maxlength="255" ></textarea>
                                <button class="btnBlueM fright" data-id="<%arr.relatedId%>"
                                        onclick="BASE.COMMON.addReply(this,BASE.ANSWER_CONTENT.addReplyAfter)" >回复</button>
                            </div>
                        </div>
                    </li>
                    <%/each%>
                </script>
        </div>
    </div>
    </div>
    <div class="fixed-icon">
        <a href="javascript:;"class="fixed-icon-item"  onclick="BASE.COMMON.scrollTop($('#content').height())">
            <img width="25px" src="../../../public/images/talk.png" alt="talk">
            {%if data.answerCount>0%}
            {{data.answerCount}}
            {%endif%}
        </a>
        <a href="javascript:;" class="fixed-icon-item" onclick="BASE.COMMON.scrollTop(1)">
            <img width="25px"  src="../../../public/images/backhome.png" alt="top">
        </a>
    </div>
</div>
{% endblock %}

{% block footer %}
{{ super() }}
<div id="modify" class="has-code">>
    {%if data%}
    {% include '__answer_popup.html' %}
    {%endif%}
</div>
{% endblock %}

{% block script %}
{{ super() }}
<!-- build:js -->
<script src="../../../public/js/page/plugin/wangEditor.js"></script>
<script src="../../../public/js/page/plugin/wangEditor-extentd.js"></script>
<script type="text/javascript" src="../../../public/js/page/SyntaxHighlighter/XRegExp.js"></script>
<script type="text/javascript" src="../../../public/js/page/SyntaxHighlighter/shCore.js"></script>
<script type="text/javascript" src="../../../public/js/page/SyntaxHighlighter/shBrushCSharp.js"></script>
<script type="text/javascript" src="../../../public/js/page/SyntaxHighlighter/shBrushCpp.js"></script>
<script type="text/javascript" src="../../../public/js/page/SyntaxHighlighter/shBrushJava.js"></script>
<script type="text/javascript" src="../../../public/js/page/SyntaxHighlighter/shBrushJScript.js"></script>
<script type="text/javascript" src="../../../public/js/page/SyntaxHighlighter/shBrushPhp.js"></script>
<script type="text/javascript" src="../../../public/js/page/SyntaxHighlighter/shBrushPython.js"></script>
<script type="text/javascript" src="../../../public/js/page/SyntaxHighlighter/shBrushPlain.js"></script>
<script type="text/javascript" src="../../../public/js/page/SyntaxHighlighter/shBrushSql.js"></script>
<script>
    SyntaxHighlighter.all();
</script>
<script src="../../../public/js/page/plugin/nativepage.js"></script>
<script src='../../../public/js/page/common/upload.js'></script>
<script src='../../../public/js/page/common/uploadAnswer.js'></script>
<script src='../../../public/js/page/common/popup.js'></script>
<script src='../../../public/js/page/answer/answer_content.js'></script>
<!-- endbuild -->
{% endblock %}